ReverbA reverb audio effector that simulates the reflections of a physical space, adding room size, damping and stereo spread to the dry signal.
Extends Effector.
import { Reverb } from "@fluex/fluexgl-dsp";
const reverb = new Reverb({
roomSize: 0.5,
damping: 0.4,
mix: 0.35,
stereoSpreadMs: 10
});
...
channel.addEffect(reverb);
new Reverb(options?: Partial<ReverbOptions>): Reverb;
options?: Partial<ReverbOptions>
Optional reverb configuration. Every field is optional and falls back to the class defaults below; numeric fields are also floored at 0.label: string | nullCustom label for this effector. Defaults to "Reverb".
name: stringInternal name for this effector. Defaults to "Reverb".
roomSize: numberSimulated room size. Defaults to 0.3.
damping: numberHigh-frequency damping amount. Defaults to 0.5.
mix: numberDry/wet balance, between 0 (dry only) and 1 (wet only). Defaults to 0.3. The processor works with separate dry and wet levels; mix is sent as dry = 1 - mix and wet = mix.
stereoSpreadMs: numberStereo spread, in milliseconds. Defaults to 0.
strictMode: StrictModeValidation mode passed through to the processor. Defaults to StrictMode.Disabled.
initializeOnAttachment(context: AudioContext): Promise<void>Initializes the reverb effect by creating the AudioWorklet processor node (ReverbProcessor) with the current option values.
context: AudioContextPromise<void>returnOptionsAsObject(): ReverbOptionsReturns a plain object snapshot of the current roomSize, damping, mix, stereoSpreadMs and strictMode values.
setRoomSize(roomSize: number): booleanUpdates roomSize (floored at 0) and forwards the change to the AudioWorklet processor.
roomSize: numberbooleansetDamping(damping: number): booleanUpdates damping (floored at 0) and forwards the change to the AudioWorklet processor.
damping: numberbooleansetMix(mix: number): booleanUpdates mix (clamped between 0 and 1) and sends dry = 1 - mix and wet = mix to the AudioWorklet processor.
Before version 0.4.9, the command ids of this class did not match the
ReverbProcessor:setMixchanged the dry level of the processor andsetStereoSpreadMsits wet level, and the initialmixwas ignored (the processor used dry 0.7 / wet 0.3). This has been fixed.
mix: numberbooleansetStereoSpreadMs(stereoSpreadMs: number): booleanUpdates stereoSpreadMs (floored at 0) and forwards the change to the AudioWorklet processor.
stereoSpreadMs: numberbooleanInherited from Effector (incoming-processor-message, incoming-processor-warning, incoming-processor-error, processor-wasm-instantiated).
This class does not define public getters or setters.